﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Fresatura.Pattern.MillingPatternSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ValueConverter="clr-namespace:CncConvProg.View.ValueConverter" 
             xmlns:Pattern="clr-namespace:CncConvProg.Model.ConversationalStructure.Lavorazioni.Fresatura.Pattern;assembly=CncConvProg.Model" mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.Resources>
        <ValueConverter:EnumToBoolConverter x:Key="EBConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height=".5*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <GroupBox Header="Pattern Selected" Grid.ColumnSpan="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width=".5*" />
                </Grid.ColumnDefinitions>
                <ListBox Margin="10" x:Name="RadioButtonList" BorderThickness="0" Background="{x:Null}">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                        <ContentPresenter/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ListBox.ItemContainerStyle>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton1, Mode=OneWay}" 
                        Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatternPoly.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.PoligonoRegolare}}" 
                        Content="Regular Polygon "
                        GroupName="Sgrossatura"
                        x:Name="RadioButton1"     
                        
                        />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton2, Mode=OneWay}"
                        Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatterneditor.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.ProfiloLibero}}" 
                        Content="Profile Editor"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton2" 
                        
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton3, Mode=OneWay}" 
                        Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatternarc.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaArco}}" 
                        Content="Arc"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton3" 
                        
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton4, Mode=OneWay}"
                            Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatterncircle.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.Cerchio}}" 
                        Content="Circle"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton4" 
                        
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton5, Mode=OneWay}"
                        Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatternSlot.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaDritta}}" 
                        Content="Slot"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton5" 
                        
                    />
                    </ListBoxItem>
                    <ListBoxItem Visibility="{Binding Path=ShowExternMillingPattern}" IsSelected="{Binding IsChecked, ElementName=RadioButton6, Mode=OneWay}"
                                 Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatternDslot.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaDrittaAperta}}" 
                        Content="D - Slot"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton6" 
                        
                    />
                    </ListBoxItem>

                    <ListBoxItem Visibility="{Binding Path=ShowExternMillingPattern}" IsSelected="{Binding IsChecked, ElementName=RadioButton7, Mode=OneWay}"
                                 Tag="pack://application:,,,/CncConvProg.View;component/Images/Work/Milling/millingPatternRect.png">
                        <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.Rettangolo}}" 
                        Content="Rectangle"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton7" 
                        
                    />
                    </ListBoxItem>
                    <!--<ListBoxItem  Visibility="{Binding Path=ShowExternMillingPattern}" IsSelected="{Binding IsChecked, ElementName=RadioButton7, Mode=OneWay}">
                <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaDrittaApertaSuCirconferenza}}" 
                        Content="Open Slot on Circonference"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton7" 
                        
                    />
            </ListBoxItem>-->
                </ListBox>
                <Image Margin="10" Grid.Column="1" Width="150" Height="150" Source="{Binding SelectedItem.Tag, ElementName=RadioButtonList}" VerticalAlignment="Top" HorizontalAlignment="Left" />
            </Grid>
        </GroupBox>
        <GroupBox Header="Pattern Parameter" Grid.Row="1" Grid.ColumnSpan="2">
            <ContentControl Content="{Binding Path=PatternParameter}"/>
        </GroupBox>
    </Grid>
</UserControl>
